#include "MemoryBounds.h"


MemoryBounds::MemoryBounds( address_t begin, address_t end )
{
	begin_ = begin;
	end_ = end;
}

MemoryBounds::MemoryBounds( const MemoryBounds&& other )
{
	begin_ = other.begin();
	end_ = other.end();
}

const address_t MemoryBounds::begin() const
{
	return begin_;
}

const address_t MemoryBounds::end() const
{
	return end_;
}

const address_t MemoryBounds::length() const
{
	return end_ - begin_;
}

bool MemoryBounds::contains( address_t addr ) const
{
	return addr >= begin_ && addr <= end_;
}

MemoryBounds MemoryBounds::fromLength( address_t begin, address_t length_ )
{
	return MemoryBounds(begin, begin + length_);
}
